#include <bits/stdc++.h>
using namespace std;
int price[100010];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> price[i];
  }
  price[n + 1] = -1;
  int di = 1, gao = 1;
  for (int i = 2; i <= n+1; i++) {
    if (price[i] >= price[i - 1]) {
      gao = i;
    } else {
      if (gao > di)
        m = m % price[di] + m / price[di] * price[gao];
      di = i;
    }
  }
  cout << m;

  return 0;
}